<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.sql.*,vo.*,dao.*,java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据处理页面</title>
</head>
<body>
<jsp:useBean id="cdao" class="dao.CourseDao"></jsp:useBean>
<jsp:useBean id="cou" class="vo.Course"></jsp:useBean>
  <%
   String courseno=request.getParameter("courseno");
    String coursename=request.getParameter("coursename");
    if(null!=coursename&&!"".equals(coursename))coursename=new String(coursename.getBytes("iso-8859-1"),"utf-8"); 
    String credit=request.getParameter("credit"); 
    String teano=request.getParameter("teano");
    cou.setCourseno(courseno);
    cou.setCoursename(coursename);
    cou.setCredit(credit);
    cou.setTeano(teano);
    if(null!=courseno){
    	cdao.insertOneCourse(cou);
   }else{
   		response.sendRedirect("stuAdmin.jsp");
   }
   %>   
   <center>
     <h2>添加课程信息</h2>
     <p>
      <br>
       新的数据已经添加到数据库中！
     </p>
    <form action="lookCourses.jsp" method="post">
       <input type="submit" value="返回">
    </form>
   </center>
</body>
</html>